import type { LoginResult } from '@/types/login'
import { http } from '@/utils/http'

type ParamsData = {
  code: string
  encryptedData: string
  iv: string
}

/**
 * 用户登录接口
 * @param data
 * @returns
 */
export const loginWeXin = (data: ParamsData) => {
  return http<LoginResult>({
    url: '/login/wxMin',
    method: 'POST',
    data,
  })
}

export const loginSimple = (phoneNumber: string) => {
  return http<LoginResult>({
    url: '/login/wxMin/simple',
    method: 'POST',
    data: {
      phoneNumber,
    },
  })
}
